
# - to ignore the error

.PHONY:clean

pwd= /home/kathik/
PATH = src/
DNAME =.depend
PWD = $(shell  ls src/*.c )

OBJ = $(patsubst %.c,%.o, $(PWD))

DEP = $(patsubst %.c,%.d, $(PWD))
_INC = -I header/
CC= gcc

out:$(OBJ)    
	$(CC)  -o $@ main.c libSTR.a  $(_INC)
	echo $(@F)
	echo $(@D)


$(DNAME):
	mkdir -p $@

#-include $(DNAME)/*.d 

%.o:%.c  $(DNAME)
	gcc -c  $< -o $@  $(_INC) 
	$(CC) -MM -MF $(DNAME)/$*.d $<    $(_INC)

pwd:
	@printf "in Make file only \n"
	@echo $(PWD)
	@printf "\n\n"
	@echo $(OBJ)

clean:
	-rm  -f *.o
	 rm -r $(DNAME)


	# rm -f $(D_NAME)/*.d
#		 @sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
		            -e '/^$$/ d' -e 's/$$/ :/' < build/$*.P >> build/$*.d;
